package phoenix.web.test_objects.data_providers;

import phoenix.core.PhoenixManager;
import phoenix.core.base.extensions.TestBaseExt;
import phoenix.core.data_models.UserProfileDataModel;
import phoenix.core.data_models.UserProfileDataModel.AboutMe;
import phoenix.core.data_models.UserProfileDataModel.LookingFor;

/**
 * Class contains test data for Funnel page
 */
public class FunnelDataProviders extends TestBaseExt
{
	public FunnelDataProviders(PhoenixManager p_phoenix)
	{
		super(p_phoenix);
	}

	public Object[][] funnelData()
	{
		String p_prefix = cronos().getCurrentDate("HHmmssyyMMdd") + randomizer().getRandomInt(1, 100).toString();
		p_prefix = p_prefix.substring(0, 5); // Cut screen name

		String screenname = (manager.testUser().getGender().equals("male")) ? "Ken_" + p_prefix : "Barby_" + p_prefix;
		testUser().setScreenname(screenname);

		UserProfileDataModel profileModel = new UserProfileDataModel(manager);
		LookingFor lookingForSettings = profileModel.new LookingFor(testUser().getGender(), testUser().getPostcode());
		lookingForSettings.fillUpForFunnel(testUser().getGender(), manager.testUser().getPostcode());

		AboutMe aboutMeSettings = profileModel.new AboutMe();
		aboutMeSettings.fillUpAboutMe();

		return new Object[][]
			{
				// Positive test
				{ screenname, lookingForSettings, aboutMeSettings }
			};
	}

	public Object[][] funnelMDData()
	{
		String p_prefix = cronos().getCurrentDate("HHmmssyyMMdd") + randomizer().getRandomInt(1, 100).toString();
		p_prefix = p_prefix.substring(0, 5); // Cut screen name

		String screenname = (manager.testUser().getGender().equals("male")) ? "Ken_" + p_prefix : "Barby_" + p_prefix;
		String p_lookingGender = (manager.testUser().getGender().equals("male")) ? "female" : "male";
		testUser().setScreenname(screenname);

		UserProfileDataModel profileModel = new UserProfileDataModel(manager);
		LookingFor fixtureForOLD = profileModel.new LookingFor(manager.testUser().getGender(), manager.testUser().getPostcode());
		fixtureForOLD
			.fillLookingFor("35", "60", manager.testUser().getPostcode(), "20", "test status", "test description",
				manager.testUser().getGender()); // age 18 - 25, radius

		AboutMe aboutMeSettings = profileModel.new AboutMe();
		aboutMeSettings.fillUpAboutMe();

		return new Object[][]
			{
				// Positive test
				{ screenname, fixtureForOLD, aboutMeSettings }
			};
	}
}
